export const axios = (
  uri: string,
  method: any = "GET",
  data: string | object | ArrayBuffer = {},
  header: any = {}
) => {
  const baseUrl = "https://www.tinyxu.fun/v1"
  const url = baseUrl + uri
  header.Authorization = "Bearer " + wx.getStorageSync("token")
  return new Promise((resolve, reject) => {
    wx.request({
      url,
      method,
      data,
      header,
      success(res) {
        resolve(res.data)
      },
      fail(err) {
        reject(err)
      },
    })
  })
}
